package com.zxt.spring_ai_demo.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @Author Mr.zeng
 * @Date 2025/8/13 19:08
 */
@Configuration
public class ChatClientConfig {
    /**
     * 指定默认 ChatModel（这里用 OpenAI，也可以换成 Ollama）
     */
    @Bean
    @Primary
    public ChatModel primaryChatModel(org.springframework.ai.openai.OpenAiChatModel openAiChatModel) {
        return openAiChatModel;
    }
    @Bean
    public ChatClient chatClient(ChatClient.Builder chatClientBuilder) {
        return chatClientBuilder
//                .defaultSystem("k哥是Java培训机构讲师，长得帅气逼人，声音浑厚有力，技术超群，授课幽默风趣")
                .build();
    }
}
